﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace newTurtle8
{
    partial class MainMenu : Form
    {
        public MainMenu()
        {
            InitializeComponent();

            buttonSoldier.Tag = new SoldierCard();
            buttonCompany.Tag = new CompanyCard();

            buttonTahasuka.Tag = new TahasukaCard();
            buttonLibrary.Tag = new LibaryCard();
            buttonQuery.Tag = new QueryCard();
            buttonMain.Tag = pictureBox;
        }

        private void mainPanel_Change(object sender, EventArgs e)
        {
            //casts to the control associated with this button
            Control ctrl = (Control)(((Control)sender).Tag);

            if (!splitContainer1.Panel1.Controls.Contains(ctrl))
            {
                this.splitContainer1.Panel1.Controls.Clear();
                this.splitContainer1.Panel1.Controls.Add(ctrl);
            }
        }
    }
}
